package procilege.impl.expand;

import procilege.compute.ExprExpandTraveller;
import procilege.compute.PlaceTypeMetadata;
import procilege.compute.PlaceType;
import procilege.lang.BoolExprElement;
import procilege.lang.BoolExprOr;

@PlaceTypeMetadata(type = BoolExprOr.class)
public class BoolExprOrExpandPlace implements PlaceType<ExprExpandTraveller> {

	public void visit(ExprExpandTraveller tr, Object place) {

		BoolExprOr plus = new BoolExprOr();

		for (BoolExprElement term : (BoolExprOr) place) {

			tr.setout(term);
			plus.add((BoolExprOr) tr.getPreviousVisitResult());
		}

		tr.result(plus);
	}
}